﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Category : System.Web.UI.Page
{
    bestlifeDataContext best = new bestlifeDataContext();
    Tbl_Category cat = new Tbl_Category();
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }
    protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {

            cat.Cat_ID = TextBoxcatID.Text;
            cat.Cat_Name = TextBoxcatName.Text;

            best.Tbl_Categories.InsertOnSubmit(cat);
            best.SubmitChanges();
            errormsg.Text = "Product Category Added Successfully!";

        }
        catch 
        {

            errormsg.Text = "Product Cannot Add ";
        }
    }
}